import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import WithdrawStatusEnum from '@/feature/fms/infra/constants/WithdrawStatusEnum'

export default [
  {
    path: '/fms',
    component: Layout,
    name: 'fms',
    meta: { title: '提现', icon: 'el-icon-s-finance' },
    children: [
      {
        path: 'withdraw',
        name: 'fms-withdraw',
        component: () => import('@/feature/fms/app/withdraw/index'),
        meta: { title: '提现', icon: 'el-icon-s-finance' },
        buttons: RouteButtonsBuilder.builder('fms-withdraw').r()
          .addButton({
            name: 'checkResolve',
            showFilter: row => row.status === WithdrawStatusEnum.WAIT_AUTH.id,
            label: '审核通过'
          })
          .addButton({
            name: 'checkReject',
            showFilter: row => row.status === WithdrawStatusEnum.WAIT_AUTH.id,
            label: '审核拒绝'
          })
          .addButton({
            name: 'money',
            showFilter: row => row.status !== WithdrawStatusEnum.RESOLVE.id,
            label: '已打款'
          })
          .build()
      },
      {
        path: 'invoice-open',
        name: 'fms-invoice-open',
        component: () => import('@/feature/fms/app/invoice-open/index'),
        meta: { title: '开票记录', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('fms-invoice-open').curdoo()
          .build()
      },
      {
        path: 'invoice-open-detail',
        name: 'fms-invoice-open-detail',
        component: () => import('@/feature/fms/app/invoice-open-detail/index'),
        meta: { title: '开票详情', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('fms-invoice-open-detail').curd()
          .build()
      },
      {
        path: 'invoice-title',
        name: 'fms-invoice-title',
        component: () => import('@/feature/fms/app/invoice-title/index'),
        meta: { title: '发票信息', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('fms-invoice-title').curd()
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
